import store from "@/store";
import dayjs from "dayjs";
export const itemStyle = {
  marginBottom: 0,
  padding: "10px 40px",
};

// 表单配置项
export const formBase = [
  {
    label: "时间",
    type: "daterange",
    field: "shelfTime",
    prop: "shelfTime",
    required: true,
    otherOptions: {
      disabled: false,
      rangeSeparator: "至",
      startPlaceholder: "开始日期",
      endPlaceholder: "结束日期",
      pickerOptions: {
        shortcuts: [
          {
            text: "今天",
            onClick(picker) {
              const end = dayjs().format("YYYY-MM-DD 23:59:59");
              const start = dayjs().format("YYYY-MM-DD 00:00:00");
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "昨天",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              end.setTime(start.getTime() - 3600 * 1000 * 24);
              start.setTime(start.getTime() - 3600 * 1000 * 24);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三天",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 3);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },
    },
  },
];

// 表格配置项
export const tableBase = [
  {
    label: "员工",
    prop: "staff",
  },
  {
    label: "入库件数",
    prop: "warehousingNum",
    width: 140,
  },
  {
    label: "入库重量",
    prop: "warehousingWeight",
    width: 200,
  },
  {
    label: "上架件数",
    prop: "groundingNum",
    width: 140,
  },
  {
    label: "上架重量",
    prop: "groundingWeight",
    width: 140,
  },
  {
    label: "下架订单数",
    prop: "offShelfOrderNum",
    width: 140,
  },
  {
    label: "下架件数",
    prop: "offShelfNum",
    width: 140,
  },
  {
    label: "下架重量",
    prop: "offShelfWeight",
    width: 140,
  },
  {
    label: "打单票数",
    prop: "blackmailTickNum",
    width: 140,
  },
  {
    label: "打单快递件数",
    prop: "blackmailDeliveryNum",
    width: 140,
  },
  {
    label: "核重票数",
    prop: "nuclearWeightTickNum",
    width: 140,
  },
  {
    label: "核重重量",
    prop: "nuclearWeightW",
    width: 140,
  },
  {
    label: "装袋票数",
    prop: "baggingTickNum",
    width: 140,
  },
  {
    label: "装车票数",
    prop: "loadingTickNum",
    width: 140,
  },
];
